from django.conf.urls import url, include
from rest_framework import routers
from . import views

router = routers.DefaultRouter()

router.register(r'hosts', views.HostView, 'hosts')
router.register(r'network', views.GetNetworkView, 'network')
router.register(r'GetNewNetwork', views.GetNewNetworkView, 'GetNewNetwork')
router.register(r'top5group', views.Top5GroupView, 'top5group')
router.register(r'CPU', views.CPUView, 'CPU')
router.register(r'CPUNew', views.CPUNewView, 'CPUNew')
router.register(r'triggers', views.TriggerView, 'triggers')
router.register(r'top5event', views.EventView, 'top5event')

urlpatterns = [
    url(r'^api/', include(router.urls)),
    url(r'^index/$', views.index, name='index'),  # index
    url(r'^auth/', include('rest_framework.urls')),
    url(r'^login/$',views.login_s, name='login'),#显示登录页面
    url(r'^', views.return_404),

]
